/*
*	Project: Aethon
*
*	File: Control.h
*
*	Author: Jonathan Hersack
*
*	Date: 2/15/2009
*
*   Purpose: The Control handles the keyboard/mouse input for the 
*   user-to-model interaction
*/

#ifndef CONTROL2_H_
#define CONTROL2_H_

#include <iostream>
#include <GL/glut.h>
#include "../include/Model.h"
#include "../include/ModelPart.h"
#include "../include/vector3f.h"
#include <GL/glut.h>
#include <math.h>

using namespace std;

class Control2{
		
	
    bool isActive;//if Director::handlernumber refers to this handler, used to check if registered or not.  
	int* handlerNumberPtr;//used to tell director which handler to register	
	
	//singleton pattern based on http://www.inquiry.com/techtips/cpp_pro/10min/10min0200.asp
	
	protected:
	Control2(){}
	Control2(const Control2&);//protect operations so instances are limited
	Control2& operator = (const Control2&);//protect operations so instances are limited
	private:
	static Control2* pinstance;
	
	public:
	static void keyboardHandle(unsigned char key, int x, int y);
	static Control2* getInstanceOf();//returns instance of Control2
	
	void setHandleNumberPtr(int* ptr)
	{
        handlerNumberPtr = ptr;
    }//end setHandlePtr

	int* getHandleNumberPtr()
	{
        return handlerNumberPtr;
    }//end setHandlePtr
	
	void setIsActive(bool active)
	{
         isActive = active;
    }//end setiswire
    
	bool getIsActive()
	{
         return isActive;
    }//end getisactive
   	
	
};//end class

#endif //CONTROL2_H_

